#ifndef __CZF_FRAME_WND_H__
#define __CZF_FRAME_WND_H__

#include "SimpleWnd.h"
#include "ToolBar.h"
#include "ReBar.h"
#include "StatusBar.h"

#define REBAR_ID        1
#define STATUSBAR_ID    2

class CFrameWnd : public CWnd
{
protected:
   CFrameWnd();
   virtual ~CFrameWnd();

public:
   DECLARE_WND_CLASS_EX (_T("CZFFrameWnd"), 0, COLOR_3DSHADOW)
   
   BEGIN_MSG_MAP(CFrameWnd)
      MESSAGE_HANDLER(WM_CREATE, OnCreate)
      MESSAGE_HANDLER(WM_CLOSE, OnClose)
      MESSAGE_HANDLER(WM_NCDESTROY, OnNcDestroy)
      MESSAGE_HANDLER(WM_SIZE, OnSize)
      MESSAGE_HANDLER(WM_MENUSELECT, OnMenuSelect)
      NOTIFY_CODE_HANDLER(RBN_AUTOSIZE, OnRebarSize)
      NOTIFY_CODE_HANDLER(TTN_GETDISPINFO, OnToolTipInfo)
   END_MSG_MAP()

protected:
   LRESULT OnCreate(UINT msg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
   LRESULT OnClose(UINT msg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);   
   LRESULT OnNcDestroy(UINT msg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);   
   LRESULT OnSize(UINT msg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);   
   LRESULT OnMenuSelect(UINT msg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);

   LRESULT OnRebarSize(int idCtrl, LPNMHDR lpNmhdr, BOOL& bHandled);
   LRESULT OnToolTipInfo(int idCtrl, LPNMHDR lpNmhdr, BOOL& bHandled);

public:
   virtual void CalcLayout(LPRECT lpRect=NULL);

public:
   CReBar      m_reBar;
   CStatusBar  m_statusBar;
   HWND        m_hwndContent;
};

#endif 